﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_QT_YONGHUFYXX实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_QT_YONGHUFYXX
    {
        private decimal? m_dec_i_bz;

        private decimal? m_dec_i_chuanlianysfyl;

        private decimal? m_dec_i_dibiaosysl;

        private decimal? m_dec_i_dixiasysl;

        private decimal? m_dec_i_gongyisfyl;

        private decimal? m_dec_i_gongyisxsl;

        private decimal? m_dec_i_gongyiszyl;

        private decimal? m_dec_i_guolucql;

        private decimal? m_dec_i_guolusxsl;

        private decimal? m_dec_i_guoluszyl;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_lenglingsfyl;

        private decimal? m_dec_i_lengquesfyl;

        private decimal? m_dec_i_lengquesxsl;

        private decimal? m_dec_i_lengqueszyl;

        private decimal? m_dec_i_m;

        private decimal? m_dec_i_qitaxsl;

        private decimal? m_dec_i_shenghuoysfyl;

        private decimal? m_dec_i_shenghuoysxsl;

        private decimal? m_dec_i_shenghuoyszyl;

        private decimal? m_dec_i_shijiyl;

        private decimal? m_dec_i_xiugair;

        private decimal? m_dec_i_y;

        private decimal? m_dec_i_zilaisysl;

        private decimal? m_dec_i_zongfuyl;

        private decimal? m_dec_i_zongxinsi;

        private decimal? m_dec_i_zongyongsl;

        private decimal m_dec_id;

        private decimal? m_dec_n_chanpinycl1;

        private decimal? m_dec_n_chanpinycl2;

        private decimal? m_dec_n_chanpinycl3;

        private decimal? m_dec_n_chongfulyl;

        private decimal? m_dec_n_danhao;

        private decimal? m_dec_n_danweicpxsl1;

        private decimal? m_dec_n_danweicpxsl2;

        private decimal? m_dec_n_danweicpxsl3;

        private decimal? m_dec_n_fuyongl;

        private decimal? m_dec_n_gongyihyl;

        private decimal? m_dec_n_lenglinghyl;

        private decimal? m_dec_n_lengquexhl;

        private decimal? m_dec_n_shenghuohyl;

        private decimal? m_dec_n_xinshuildh;

        private decimal? m_dec_n_zongchanz;

        private DateTime? m_DT_d_caozuosj;

        private DateTime? m_DT_d_xiugairq;

        private string m_str_s_caozuor;

        private string m_str_s_chanpin1;

        private string m_str_s_chanpin2;

        private string m_str_s_chanpin3;

        private string m_str_s_guanlikh;

        private string m_str_s_xingzhengqh;

        private string m_str_s_yonghuh;

        private string m_str_s_yongshuixz;

        private string m_str_s_zhandianbh;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     站点
        /// </summary>
        public string S_ZHANDIANBH
        {
            get { return m_str_s_zhandianbh; }
            set { m_str_s_zhandianbh = value; }
        }

        /// <summary>
        ///     用户号
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }

        /// <summary>
        ///     水量年
        /// </summary>
        public decimal? I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     水量月
        /// </summary>
        public decimal? I_M
        {
            get { return m_dec_i_m; }
            set { m_dec_i_m = value; }
        }

        /// <summary>
        ///     用水性质
        /// </summary>
        public string S_YONGSHUIXZ
        {
            get { return m_str_s_yongshuixz; }
            set { m_str_s_yongshuixz = value; }
        }

        /// <summary>
        ///     管理块
        /// </summary>
        public string S_GUANLIKH
        {
            get { return m_str_s_guanlikh; }
            set { m_str_s_guanlikh = value; }
        }

        /// <summary>
        ///     行政区
        /// </summary>
        public string S_XINGZHENGQH
        {
            get { return m_str_s_xingzhengqh; }
            set { m_str_s_xingzhengqh = value; }
        }

        /// <summary>
        ///     总用水量
        /// </summary>
        public decimal? I_ZONGYONGSL
        {
            get { return m_dec_i_zongyongsl; }
            set { m_dec_i_zongyongsl = value; }
        }

        /// <summary>
        ///     自来水用水量
        /// </summary>
        public decimal? I_ZILAISYSL
        {
            get { return m_dec_i_zilaisysl; }
            set { m_dec_i_zilaisysl = value; }
        }

        /// <summary>
        ///     地下水用水量
        /// </summary>
        public decimal? I_DIXIASYSL
        {
            get { return m_dec_i_dixiasysl; }
            set { m_dec_i_dixiasysl = value; }
        }

        /// <summary>
        ///     地表水用水量
        /// </summary>
        public decimal? I_DIBIAOSYSL
        {
            get { return m_dec_i_dibiaosysl; }
            set { m_dec_i_dibiaosysl = value; }
        }

        /// <summary>
        ///     冷却水总用量
        /// </summary>
        public decimal? I_LENGQUESZYL
        {
            get { return m_dec_i_lengqueszyl; }
            set { m_dec_i_lengqueszyl = value; }
        }

        /// <summary>
        ///     工艺水总用量
        /// </summary>
        public decimal? I_GONGYISZYL
        {
            get { return m_dec_i_gongyiszyl; }
            set { m_dec_i_gongyiszyl = value; }
        }

        /// <summary>
        ///     锅炉水总用量
        /// </summary>
        public decimal? I_GUOLUSZYL
        {
            get { return m_dec_i_guoluszyl; }
            set { m_dec_i_guoluszyl = value; }
        }

        /// <summary>
        ///     生活用水总用量
        /// </summary>
        public decimal? I_SHENGHUOYSZYL
        {
            get { return m_dec_i_shenghuoyszyl; }
            set { m_dec_i_shenghuoyszyl = value; }
        }

        /// <summary>
        ///     冷却水新水量
        /// </summary>
        public decimal? I_LENGQUESXSL
        {
            get { return m_dec_i_lengquesxsl; }
            set { m_dec_i_lengquesxsl = value; }
        }

        /// <summary>
        ///     工艺水新水量
        /// </summary>
        public decimal? I_GONGYISXSL
        {
            get { return m_dec_i_gongyisxsl; }
            set { m_dec_i_gongyisxsl = value; }
        }

        /// <summary>
        ///     锅炉水新水量
        /// </summary>
        public decimal? I_GUOLUSXSL
        {
            get { return m_dec_i_guolusxsl; }
            set { m_dec_i_guolusxsl = value; }
        }

        /// <summary>
        ///     生活用水新水量
        /// </summary>
        public decimal? I_SHENGHUOYSXSL
        {
            get { return m_dec_i_shenghuoysxsl; }
            set { m_dec_i_shenghuoysxsl = value; }
        }

        /// <summary>
        ///     其他新水量
        /// </summary>
        public decimal? I_QITAXSL
        {
            get { return m_dec_i_qitaxsl; }
            set { m_dec_i_qitaxsl = value; }
        }

        /// <summary>
        ///     总新水量
        /// </summary>
        public decimal? I_ZONGXINSI
        {
            get { return m_dec_i_zongxinsi; }
            set { m_dec_i_zongxinsi = value; }
        }

        /// <summary>
        ///     冷却水复用量
        /// </summary>
        public decimal? I_LENGQUESFYL
        {
            get { return m_dec_i_lengquesfyl; }
            set { m_dec_i_lengquesfyl = value; }
        }

        /// <summary>
        ///     工艺水复用量
        /// </summary>
        public decimal? I_GONGYISFYL
        {
            get { return m_dec_i_gongyisfyl; }
            set { m_dec_i_gongyisfyl = value; }
        }

        /// <summary>
        ///     冷凝水复用量
        /// </summary>
        public decimal? I_LENGLINGSFYL
        {
            get { return m_dec_i_lenglingsfyl; }
            set { m_dec_i_lenglingsfyl = value; }
        }

        /// <summary>
        ///     生活用水复用量
        /// </summary>
        public decimal? I_SHENGHUOYSFYL
        {
            get { return m_dec_i_shenghuoysfyl; }
            set { m_dec_i_shenghuoysfyl = value; }
        }

        /// <summary>
        ///     串联用水复用量
        /// </summary>
        public decimal? I_CHUANLIANYSFYL
        {
            get { return m_dec_i_chuanlianysfyl; }
            set { m_dec_i_chuanlianysfyl = value; }
        }

        /// <summary>
        ///     总复用水量
        /// </summary>
        public decimal? I_ZONGFUYL
        {
            get { return m_dec_i_zongfuyl; }
            set { m_dec_i_zongfuyl = value; }
        }

        /// <summary>
        ///     锅炉产气量
        /// </summary>
        public decimal? I_GUOLUCQL
        {
            get { return m_dec_i_guolucql; }
            set { m_dec_i_guolucql = value; }
        }

        /// <summary>
        ///     总产值
        /// </summary>
        public decimal? N_ZONGCHANZ
        {
            get { return m_dec_n_zongchanz; }
            set { m_dec_n_zongchanz = value; }
        }

        /// <summary>
        ///     新水量单耗(吨/万元)
        /// </summary>
        public decimal? N_XINSHUILDH
        {
            get { return m_dec_n_xinshuildh; }
            set { m_dec_n_xinshuildh = value; }
        }

        /// <summary>
        ///     产品1
        /// </summary>
        public string S_CHANPIN1
        {
            get { return m_str_s_chanpin1; }
            set { m_str_s_chanpin1 = value; }
        }

        /// <summary>
        ///     单位产品新水量1
        /// </summary>
        public decimal? N_DANWEICPXSL1
        {
            get { return m_dec_n_danweicpxsl1; }
            set { m_dec_n_danweicpxsl1 = value; }
        }

        /// <summary>
        ///     产品月产量1
        /// </summary>
        public decimal? N_CHANPINYCL1
        {
            get { return m_dec_n_chanpinycl1; }
            set { m_dec_n_chanpinycl1 = value; }
        }

        /// <summary>
        ///     产品2
        /// </summary>
        public string S_CHANPIN2
        {
            get { return m_str_s_chanpin2; }
            set { m_str_s_chanpin2 = value; }
        }

        /// <summary>
        ///     单位产品新水量2
        /// </summary>
        public decimal? N_DANWEICPXSL2
        {
            get { return m_dec_n_danweicpxsl2; }
            set { m_dec_n_danweicpxsl2 = value; }
        }

        /// <summary>
        ///     产品月产量2
        /// </summary>
        public decimal? N_CHANPINYCL2
        {
            get { return m_dec_n_chanpinycl2; }
            set { m_dec_n_chanpinycl2 = value; }
        }

        /// <summary>
        ///     产品3
        /// </summary>
        public string S_CHANPIN3
        {
            get { return m_str_s_chanpin3; }
            set { m_str_s_chanpin3 = value; }
        }

        /// <summary>
        ///     单位产品新水量3
        /// </summary>
        public decimal? N_DANWEICPXSL3
        {
            get { return m_dec_n_danweicpxsl3; }
            set { m_dec_n_danweicpxsl3 = value; }
        }

        /// <summary>
        ///     产品月产量3
        /// </summary>
        public decimal? N_CHANPINYCL3
        {
            get { return m_dec_n_chanpinycl3; }
            set { m_dec_n_chanpinycl3 = value; }
        }

        /// <summary>
        ///     重复利用率
        /// </summary>
        public decimal? N_CHONGFULYL
        {
            get { return m_dec_n_chongfulyl; }
            set { m_dec_n_chongfulyl = value; }
        }

        /// <summary>
        ///     冷却循环率
        /// </summary>
        public decimal? N_LENGQUEXHL
        {
            get { return m_dec_n_lengquexhl; }
            set { m_dec_n_lengquexhl = value; }
        }

        /// <summary>
        ///     工艺回用率
        /// </summary>
        public decimal? N_GONGYIHYL
        {
            get { return m_dec_n_gongyihyl; }
            set { m_dec_n_gongyihyl = value; }
        }

        /// <summary>
        ///     生活回用率
        /// </summary>
        public decimal? N_SHENGHUOHYL
        {
            get { return m_dec_n_shenghuohyl; }
            set { m_dec_n_shenghuohyl = value; }
        }

        /// <summary>
        ///     冷凝回用率
        /// </summary>
        public decimal? N_LENGLINGHYL
        {
            get { return m_dec_n_lenglinghyl; }
            set { m_dec_n_lenglinghyl = value; }
        }

        /// <summary>
        ///     实际用量
        /// </summary>
        public decimal? I_SHIJIYL
        {
            get { return m_dec_i_shijiyl; }
            set { m_dec_i_shijiyl = value; }
        }

        /// <summary>
        ///     复用率
        /// </summary>
        public decimal? N_FUYONGL
        {
            get { return m_dec_n_fuyongl; }
            set { m_dec_n_fuyongl = value; }
        }

        /// <summary>
        ///     单耗
        /// </summary>
        public decimal? N_DANHAO
        {
            get { return m_dec_n_danhao; }
            set { m_dec_n_danhao = value; }
        }

        /// <summary>
        ///     采集成功标志
        /// </summary>
        public decimal? I_BZ
        {
            get { return m_dec_i_bz; }
            set { m_dec_i_bz = value; }
        }

        /// <summary>
        ///     修改日期
        /// </summary>
        public DateTime? D_XIUGAIRQ
        {
            get { return m_DT_d_xiugairq; }
            set { m_DT_d_xiugairq = value; }
        }

        /// <summary>
        ///     修改人
        /// </summary>
        public decimal? I_XIUGAIR
        {
            get { return m_dec_i_xiugair; }
            set { m_dec_i_xiugair = value; }
        }

        /// <summary>
        ///     0:正常 -1:删除
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        /// </summary>
        public DateTime? D_CAOZUOSJ
        {
            get { return m_DT_d_caozuosj; }
            set { m_DT_d_caozuosj = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_QT_YONGHUFYXXProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_QT_YONGHUFYXXProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_QT_YONGHUFYXX实体添加或者修改YS_QT_YONGHUFYXX信息
        /// </summary>
        public bool InsertOrUpdate(YS_QT_YONGHUFYXX YS_QT_YONGHUFYXX, OracleTransaction Transaction)
        {
            if (YS_QT_YONGHUFYXX.ID == 0)
                InsertYS_QT_YONGHUFYXX(YS_QT_YONGHUFYXX, Transaction);
            else
                UpdateYS_QT_YONGHUFYXX(YS_QT_YONGHUFYXX, Transaction);
            return YS_QT_YONGHUFYXX.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_QT_YONGHUFYXX实体添加或修改YS_QT_YONGHUFYXX信息
        /// </summary>
        public bool InsertOrUpdate(YS_QT_YONGHUFYXX YS_QT_YONGHUFYXX)
        {
            return InsertOrUpdate(YS_QT_YONGHUFYXX, null);
        }


        /// <summary>
        ///     根据YS_QT_YONGHUFYXX主键删除YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_QT_YONGHUFYXX(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_QT_YONGHUFYXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_QT_YONGHUFYXX主键删除YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_QT_YONGHUFYXX(decimal ID)
        {
            return DeleteYS_QT_YONGHUFYXX(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_QT_YONGHUFYXXesDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_QT_YONGHUFYXXesDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_QT_YONGHUFYXXesDynamic(string WhereClause)
        {
            return DeleteYS_QT_YONGHUFYXXesDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_QT_YONGHUFYXX主键选择YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_YONGHUFYXX信息</returns>
        public YS_QT_YONGHUFYXX SelectYS_QT_YONGHUFYXX(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_YONGHUFYXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_QT_YONGHUFYXX = PopulateYS_QT_YONGHUFYXX(rd);
                rd.Close();
                return YS_QT_YONGHUFYXX;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_QT_YONGHUFYXX主键选择YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <returns>YS_QT_YONGHUFYXX信息</returns>
        public YS_QT_YONGHUFYXX SelectYS_QT_YONGHUFYXX(decimal ID)
        {
            return SelectYS_QT_YONGHUFYXX(ID, null);
        }

        /// <summary>
        ///     选择所有YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_QT_YONGHUFYXX信息</returns>
        public DataTable SelectYS_QT_YONGHUFYXXesAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_YONGHUFYXXesAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <returns>所有YS_QT_YONGHUFYXX信息</returns>
        public DataTable SelectYS_QT_YONGHUFYXXesAll()
        {
            return SelectYS_QT_YONGHUFYXXesAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_YONGHUFYXX信息</returns>
        public DataTable SelectYS_QT_YONGHUFYXXesDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_YONGHUFYXXesDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_QT_YONGHUFYXX信息</returns>
        public DataTable SelectYS_QT_YONGHUFYXXesDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_QT_YONGHUFYXXesDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_QT_YONGHUFYXX信息</returns>
        public DataTable SelectYS_QT_YONGHUFYXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_QT_YONGHUFYXXesDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_QT_YONGHUFYXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_QT_YONGHUFYXX信息</returns>
        public DataTable SelectYS_QT_YONGHUFYXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_QT_YONGHUFYXXesDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_QT_YONGHUFYXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_QT_YONGHUFYXXesDynamic(string UpdateValue, string WhereClause,
            OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_QT_YONGHUFYXXDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_QT_YONGHUFYXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_QT_YONGHUFYXXesDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_QT_YONGHUFYXXesDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_QT_YONGHUFYXX(YS_QT_YONGHUFYXX YS_QT_YONGHUFYXX, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_QT_YONGHUFYXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_QT_YONGHUFYXX.S_ZHANDIANBH;
            storedParams[1].Value = YS_QT_YONGHUFYXX.S_YONGHUH;
            storedParams[2].Value = YS_QT_YONGHUFYXX.I_Y;
            storedParams[3].Value = YS_QT_YONGHUFYXX.I_M;
            storedParams[4].Value = YS_QT_YONGHUFYXX.S_YONGSHUIXZ;
            storedParams[5].Value = YS_QT_YONGHUFYXX.S_GUANLIKH;
            storedParams[6].Value = YS_QT_YONGHUFYXX.S_XINGZHENGQH;
            storedParams[7].Value = YS_QT_YONGHUFYXX.I_ZONGYONGSL;
            storedParams[8].Value = YS_QT_YONGHUFYXX.I_ZILAISYSL;
            storedParams[9].Value = YS_QT_YONGHUFYXX.I_DIXIASYSL;
            storedParams[10].Value = YS_QT_YONGHUFYXX.I_DIBIAOSYSL;
            storedParams[11].Value = YS_QT_YONGHUFYXX.I_LENGQUESZYL;
            storedParams[12].Value = YS_QT_YONGHUFYXX.I_GONGYISZYL;
            storedParams[13].Value = YS_QT_YONGHUFYXX.I_GUOLUSZYL;
            storedParams[14].Value = YS_QT_YONGHUFYXX.I_SHENGHUOYSZYL;
            storedParams[15].Value = YS_QT_YONGHUFYXX.I_LENGQUESXSL;
            storedParams[16].Value = YS_QT_YONGHUFYXX.I_GONGYISXSL;
            storedParams[17].Value = YS_QT_YONGHUFYXX.I_GUOLUSXSL;
            storedParams[18].Value = YS_QT_YONGHUFYXX.I_SHENGHUOYSXSL;
            storedParams[19].Value = YS_QT_YONGHUFYXX.I_QITAXSL;
            storedParams[20].Value = YS_QT_YONGHUFYXX.I_ZONGXINSI;
            storedParams[21].Value = YS_QT_YONGHUFYXX.I_LENGQUESFYL;
            storedParams[22].Value = YS_QT_YONGHUFYXX.I_GONGYISFYL;
            storedParams[23].Value = YS_QT_YONGHUFYXX.I_LENGLINGSFYL;
            storedParams[24].Value = YS_QT_YONGHUFYXX.I_SHENGHUOYSFYL;
            storedParams[25].Value = YS_QT_YONGHUFYXX.I_CHUANLIANYSFYL;
            storedParams[26].Value = YS_QT_YONGHUFYXX.I_ZONGFUYL;
            storedParams[27].Value = YS_QT_YONGHUFYXX.I_GUOLUCQL;
            storedParams[28].Value = YS_QT_YONGHUFYXX.N_ZONGCHANZ;
            storedParams[29].Value = YS_QT_YONGHUFYXX.N_XINSHUILDH;
            storedParams[30].Value = YS_QT_YONGHUFYXX.S_CHANPIN1;
            storedParams[31].Value = YS_QT_YONGHUFYXX.N_DANWEICPXSL1;
            storedParams[32].Value = YS_QT_YONGHUFYXX.N_CHANPINYCL1;
            storedParams[33].Value = YS_QT_YONGHUFYXX.S_CHANPIN2;
            storedParams[34].Value = YS_QT_YONGHUFYXX.N_DANWEICPXSL2;
            storedParams[35].Value = YS_QT_YONGHUFYXX.N_CHANPINYCL2;
            storedParams[36].Value = YS_QT_YONGHUFYXX.S_CHANPIN3;
            storedParams[37].Value = YS_QT_YONGHUFYXX.N_DANWEICPXSL3;
            storedParams[38].Value = YS_QT_YONGHUFYXX.N_CHANPINYCL3;
            storedParams[39].Value = YS_QT_YONGHUFYXX.N_CHONGFULYL;
            storedParams[40].Value = YS_QT_YONGHUFYXX.N_LENGQUEXHL;
            storedParams[41].Value = YS_QT_YONGHUFYXX.N_GONGYIHYL;
            storedParams[42].Value = YS_QT_YONGHUFYXX.N_SHENGHUOHYL;
            storedParams[43].Value = YS_QT_YONGHUFYXX.N_LENGLINGHYL;
            storedParams[44].Value = YS_QT_YONGHUFYXX.I_SHIJIYL;
            storedParams[45].Value = YS_QT_YONGHUFYXX.N_FUYONGL;
            storedParams[46].Value = YS_QT_YONGHUFYXX.N_DANHAO;
            storedParams[47].Value = YS_QT_YONGHUFYXX.I_BZ;
            storedParams[48].Value = YS_QT_YONGHUFYXX.D_XIUGAIRQ;
            storedParams[49].Value = YS_QT_YONGHUFYXX.I_XIUGAIR;
            storedParams[50].Value = YS_QT_YONGHUFYXX.I_JLZT;
            storedParams[51].Value = YS_QT_YONGHUFYXX.S_CAOZUOR;
            storedParams[52].Value = YS_QT_YONGHUFYXX.D_CAOZUOSJ;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_QT_YONGHUFYXX.ID = Convert.ToInt32(storedParams[53].Value);
            return result;
        }

        private bool UpdateYS_QT_YONGHUFYXX(YS_QT_YONGHUFYXX YS_QT_YONGHUFYXX, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_QT_YONGHUFYXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_QT_YONGHUFYXX.S_ZHANDIANBH;
            storedParams[1].Value = YS_QT_YONGHUFYXX.S_YONGHUH;
            storedParams[2].Value = YS_QT_YONGHUFYXX.I_Y;
            storedParams[3].Value = YS_QT_YONGHUFYXX.I_M;
            storedParams[4].Value = YS_QT_YONGHUFYXX.S_YONGSHUIXZ;
            storedParams[5].Value = YS_QT_YONGHUFYXX.S_GUANLIKH;
            storedParams[6].Value = YS_QT_YONGHUFYXX.S_XINGZHENGQH;
            storedParams[7].Value = YS_QT_YONGHUFYXX.I_ZONGYONGSL;
            storedParams[8].Value = YS_QT_YONGHUFYXX.I_ZILAISYSL;
            storedParams[9].Value = YS_QT_YONGHUFYXX.I_DIXIASYSL;
            storedParams[10].Value = YS_QT_YONGHUFYXX.I_DIBIAOSYSL;
            storedParams[11].Value = YS_QT_YONGHUFYXX.I_LENGQUESZYL;
            storedParams[12].Value = YS_QT_YONGHUFYXX.I_GONGYISZYL;
            storedParams[13].Value = YS_QT_YONGHUFYXX.I_GUOLUSZYL;
            storedParams[14].Value = YS_QT_YONGHUFYXX.I_SHENGHUOYSZYL;
            storedParams[15].Value = YS_QT_YONGHUFYXX.I_LENGQUESXSL;
            storedParams[16].Value = YS_QT_YONGHUFYXX.I_GONGYISXSL;
            storedParams[17].Value = YS_QT_YONGHUFYXX.I_GUOLUSXSL;
            storedParams[18].Value = YS_QT_YONGHUFYXX.I_SHENGHUOYSXSL;
            storedParams[19].Value = YS_QT_YONGHUFYXX.I_QITAXSL;
            storedParams[20].Value = YS_QT_YONGHUFYXX.I_ZONGXINSI;
            storedParams[21].Value = YS_QT_YONGHUFYXX.I_LENGQUESFYL;
            storedParams[22].Value = YS_QT_YONGHUFYXX.I_GONGYISFYL;
            storedParams[23].Value = YS_QT_YONGHUFYXX.I_LENGLINGSFYL;
            storedParams[24].Value = YS_QT_YONGHUFYXX.I_SHENGHUOYSFYL;
            storedParams[25].Value = YS_QT_YONGHUFYXX.I_CHUANLIANYSFYL;
            storedParams[26].Value = YS_QT_YONGHUFYXX.I_ZONGFUYL;
            storedParams[27].Value = YS_QT_YONGHUFYXX.I_GUOLUCQL;
            storedParams[28].Value = YS_QT_YONGHUFYXX.N_ZONGCHANZ;
            storedParams[29].Value = YS_QT_YONGHUFYXX.N_XINSHUILDH;
            storedParams[30].Value = YS_QT_YONGHUFYXX.S_CHANPIN1;
            storedParams[31].Value = YS_QT_YONGHUFYXX.N_DANWEICPXSL1;
            storedParams[32].Value = YS_QT_YONGHUFYXX.N_CHANPINYCL1;
            storedParams[33].Value = YS_QT_YONGHUFYXX.S_CHANPIN2;
            storedParams[34].Value = YS_QT_YONGHUFYXX.N_DANWEICPXSL2;
            storedParams[35].Value = YS_QT_YONGHUFYXX.N_CHANPINYCL2;
            storedParams[36].Value = YS_QT_YONGHUFYXX.S_CHANPIN3;
            storedParams[37].Value = YS_QT_YONGHUFYXX.N_DANWEICPXSL3;
            storedParams[38].Value = YS_QT_YONGHUFYXX.N_CHANPINYCL3;
            storedParams[39].Value = YS_QT_YONGHUFYXX.N_CHONGFULYL;
            storedParams[40].Value = YS_QT_YONGHUFYXX.N_LENGQUEXHL;
            storedParams[41].Value = YS_QT_YONGHUFYXX.N_GONGYIHYL;
            storedParams[42].Value = YS_QT_YONGHUFYXX.N_SHENGHUOHYL;
            storedParams[43].Value = YS_QT_YONGHUFYXX.N_LENGLINGHYL;
            storedParams[44].Value = YS_QT_YONGHUFYXX.I_SHIJIYL;
            storedParams[45].Value = YS_QT_YONGHUFYXX.N_FUYONGL;
            storedParams[46].Value = YS_QT_YONGHUFYXX.N_DANHAO;
            storedParams[47].Value = YS_QT_YONGHUFYXX.I_BZ;
            storedParams[48].Value = YS_QT_YONGHUFYXX.D_XIUGAIRQ;
            storedParams[49].Value = YS_QT_YONGHUFYXX.I_XIUGAIR;
            storedParams[50].Value = YS_QT_YONGHUFYXX.I_JLZT;
            storedParams[51].Value = YS_QT_YONGHUFYXX.S_CAOZUOR;
            storedParams[52].Value = YS_QT_YONGHUFYXX.D_CAOZUOSJ;
            storedParams[53].Value = YS_QT_YONGHUFYXX.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_QT_YONGHUFYXX PopulateYS_QT_YONGHUFYXX(IDataReader dr)
        {
            var YS_QT_YONGHUFYXX = new YS_QT_YONGHUFYXX();
            YS_QT_YONGHUFYXX.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_QT_YONGHUFYXX.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? null : (string) dr["S_ZHANDIANBH"];
            YS_QT_YONGHUFYXX.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string) dr["S_YONGHUH"];
            YS_QT_YONGHUFYXX.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?) dr["I_Y"];
            YS_QT_YONGHUFYXX.I_M = dr["I_M"] == DBNull.Value ? null : (decimal?) dr["I_M"];
            YS_QT_YONGHUFYXX.S_YONGSHUIXZ = dr["S_YONGSHUIXZ"] == DBNull.Value ? null : (string) dr["S_YONGSHUIXZ"];
            YS_QT_YONGHUFYXX.S_GUANLIKH = dr["S_GUANLIKH"] == DBNull.Value ? null : (string) dr["S_GUANLIKH"];
            YS_QT_YONGHUFYXX.S_XINGZHENGQH = dr["S_XINGZHENGQH"] == DBNull.Value ? null : (string) dr["S_XINGZHENGQH"];
            YS_QT_YONGHUFYXX.I_ZONGYONGSL = dr["I_ZONGYONGSL"] == DBNull.Value ? null : (decimal?) dr["I_ZONGYONGSL"];
            YS_QT_YONGHUFYXX.I_ZILAISYSL = dr["I_ZILAISYSL"] == DBNull.Value ? null : (decimal?) dr["I_ZILAISYSL"];
            YS_QT_YONGHUFYXX.I_DIXIASYSL = dr["I_DIXIASYSL"] == DBNull.Value ? null : (decimal?) dr["I_DIXIASYSL"];
            YS_QT_YONGHUFYXX.I_DIBIAOSYSL = dr["I_DIBIAOSYSL"] == DBNull.Value ? null : (decimal?) dr["I_DIBIAOSYSL"];
            YS_QT_YONGHUFYXX.I_LENGQUESZYL =
                dr["I_LENGQUESZYL"] == DBNull.Value ? null : (decimal?) dr["I_LENGQUESZYL"];
            YS_QT_YONGHUFYXX.I_GONGYISZYL = dr["I_GONGYISZYL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYISZYL"];
            YS_QT_YONGHUFYXX.I_GUOLUSZYL = dr["I_GUOLUSZYL"] == DBNull.Value ? null : (decimal?) dr["I_GUOLUSZYL"];
            YS_QT_YONGHUFYXX.I_SHENGHUOYSZYL =
                dr["I_SHENGHUOYSZYL"] == DBNull.Value ? null : (decimal?) dr["I_SHENGHUOYSZYL"];
            YS_QT_YONGHUFYXX.I_LENGQUESXSL =
                dr["I_LENGQUESXSL"] == DBNull.Value ? null : (decimal?) dr["I_LENGQUESXSL"];
            YS_QT_YONGHUFYXX.I_GONGYISXSL = dr["I_GONGYISXSL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYISXSL"];
            YS_QT_YONGHUFYXX.I_GUOLUSXSL = dr["I_GUOLUSXSL"] == DBNull.Value ? null : (decimal?) dr["I_GUOLUSXSL"];
            YS_QT_YONGHUFYXX.I_SHENGHUOYSXSL =
                dr["I_SHENGHUOYSXSL"] == DBNull.Value ? null : (decimal?) dr["I_SHENGHUOYSXSL"];
            YS_QT_YONGHUFYXX.I_QITAXSL = dr["I_QITAXSL"] == DBNull.Value ? null : (decimal?) dr["I_QITAXSL"];
            YS_QT_YONGHUFYXX.I_ZONGXINSI = dr["I_ZONGXINSI"] == DBNull.Value ? null : (decimal?) dr["I_ZONGXINSI"];
            YS_QT_YONGHUFYXX.I_LENGQUESFYL =
                dr["I_LENGQUESFYL"] == DBNull.Value ? null : (decimal?) dr["I_LENGQUESFYL"];
            YS_QT_YONGHUFYXX.I_GONGYISFYL = dr["I_GONGYISFYL"] == DBNull.Value ? null : (decimal?) dr["I_GONGYISFYL"];
            YS_QT_YONGHUFYXX.I_LENGLINGSFYL =
                dr["I_LENGLINGSFYL"] == DBNull.Value ? null : (decimal?) dr["I_LENGLINGSFYL"];
            YS_QT_YONGHUFYXX.I_SHENGHUOYSFYL =
                dr["I_SHENGHUOYSFYL"] == DBNull.Value ? null : (decimal?) dr["I_SHENGHUOYSFYL"];
            YS_QT_YONGHUFYXX.I_CHUANLIANYSFYL =
                dr["I_CHUANLIANYSFYL"] == DBNull.Value ? null : (decimal?) dr["I_CHUANLIANYSFYL"];
            YS_QT_YONGHUFYXX.I_ZONGFUYL = dr["I_ZONGFUYL"] == DBNull.Value ? null : (decimal?) dr["I_ZONGFUYL"];
            YS_QT_YONGHUFYXX.I_GUOLUCQL = dr["I_GUOLUCQL"] == DBNull.Value ? null : (decimal?) dr["I_GUOLUCQL"];
            YS_QT_YONGHUFYXX.N_ZONGCHANZ = dr["N_ZONGCHANZ"] == DBNull.Value ? null : (decimal?) dr["N_ZONGCHANZ"];
            YS_QT_YONGHUFYXX.N_XINSHUILDH = dr["N_XINSHUILDH"] == DBNull.Value ? null : (decimal?) dr["N_XINSHUILDH"];
            YS_QT_YONGHUFYXX.S_CHANPIN1 = dr["S_CHANPIN1"] == DBNull.Value ? null : (string) dr["S_CHANPIN1"];
            YS_QT_YONGHUFYXX.N_DANWEICPXSL1 =
                dr["N_DANWEICPXSL1"] == DBNull.Value ? null : (decimal?) dr["N_DANWEICPXSL1"];
            YS_QT_YONGHUFYXX.N_CHANPINYCL1 =
                dr["N_CHANPINYCL1"] == DBNull.Value ? null : (decimal?) dr["N_CHANPINYCL1"];
            YS_QT_YONGHUFYXX.S_CHANPIN2 = dr["S_CHANPIN2"] == DBNull.Value ? null : (string) dr["S_CHANPIN2"];
            YS_QT_YONGHUFYXX.N_DANWEICPXSL2 =
                dr["N_DANWEICPXSL2"] == DBNull.Value ? null : (decimal?) dr["N_DANWEICPXSL2"];
            YS_QT_YONGHUFYXX.N_CHANPINYCL2 =
                dr["N_CHANPINYCL2"] == DBNull.Value ? null : (decimal?) dr["N_CHANPINYCL2"];
            YS_QT_YONGHUFYXX.S_CHANPIN3 = dr["S_CHANPIN3"] == DBNull.Value ? null : (string) dr["S_CHANPIN3"];
            YS_QT_YONGHUFYXX.N_DANWEICPXSL3 =
                dr["N_DANWEICPXSL3"] == DBNull.Value ? null : (decimal?) dr["N_DANWEICPXSL3"];
            YS_QT_YONGHUFYXX.N_CHANPINYCL3 =
                dr["N_CHANPINYCL3"] == DBNull.Value ? null : (decimal?) dr["N_CHANPINYCL3"];
            YS_QT_YONGHUFYXX.N_CHONGFULYL = dr["N_CHONGFULYL"] == DBNull.Value ? null : (decimal?) dr["N_CHONGFULYL"];
            YS_QT_YONGHUFYXX.N_LENGQUEXHL = dr["N_LENGQUEXHL"] == DBNull.Value ? null : (decimal?) dr["N_LENGQUEXHL"];
            YS_QT_YONGHUFYXX.N_GONGYIHYL = dr["N_GONGYIHYL"] == DBNull.Value ? null : (decimal?) dr["N_GONGYIHYL"];
            YS_QT_YONGHUFYXX.N_SHENGHUOHYL =
                dr["N_SHENGHUOHYL"] == DBNull.Value ? null : (decimal?) dr["N_SHENGHUOHYL"];
            YS_QT_YONGHUFYXX.N_LENGLINGHYL =
                dr["N_LENGLINGHYL"] == DBNull.Value ? null : (decimal?) dr["N_LENGLINGHYL"];
            YS_QT_YONGHUFYXX.I_SHIJIYL = dr["I_SHIJIYL"] == DBNull.Value ? null : (decimal?) dr["I_SHIJIYL"];
            YS_QT_YONGHUFYXX.N_FUYONGL = dr["N_FUYONGL"] == DBNull.Value ? null : (decimal?) dr["N_FUYONGL"];
            YS_QT_YONGHUFYXX.N_DANHAO = dr["N_DANHAO"] == DBNull.Value ? null : (decimal?) dr["N_DANHAO"];
            YS_QT_YONGHUFYXX.I_BZ = dr["I_BZ"] == DBNull.Value ? null : (decimal?) dr["I_BZ"];
            YS_QT_YONGHUFYXX.D_XIUGAIRQ = dr["D_XIUGAIRQ"] == DBNull.Value ? null : (DateTime?) dr["D_XIUGAIRQ"];
            YS_QT_YONGHUFYXX.I_XIUGAIR = dr["I_XIUGAIR"] == DBNull.Value ? null : (decimal?) dr["I_XIUGAIR"];
            YS_QT_YONGHUFYXX.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            YS_QT_YONGHUFYXX.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            YS_QT_YONGHUFYXX.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUOSJ"];
            return YS_QT_YONGHUFYXX;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion